﻿using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
using VisionCloud.Domain.Common;
using VisionCloud.Domain.DtoModel.Sys;
using VisionCloud.Domain.Filters;
using VisionCloud.Service.Sys;

namespace VisionCloud.Api.Controllers.Sys
{
    /// <summary>
    /// App信息控制器
    /// </summary>
    [SystemModuleAttribute("App信息控制器")]
    [ApiVersion("1.0")]
    [Route("api/sys/[controller]/[Action]")]
    [ApiExplorerSettings(GroupName = "App信息控制器")]
    public class AppController : ApiBaseController
    {
        /// <summary>
        /// 用户服务
        /// </summary>
        public UserService UserService { get; set; }

        /// <summary>
        ///  获取Surface更新包信息
        /// </summary>
        /// <returns></returns>
        [AllowAnonymous]
        [HttpPost]
        public async Task<ApiResult> GetSurfaceVersionInfo(AppDto appDto)
        {
            return await TryCatchAsync(UserService.GetSurfaceVersionInfo(appDto));
        }
    }
}